import React, { Component,Suspense,lazy } from 'react';
import { Button } from 'element-react';

/**
 * 异步加载
 * @type {React.LazyExoticComponent<React.ComponentType<any>>}
 */
const ContextDemo = lazy(()=> import('./ContextDemo'))
export default class StateScreen extends Component {
    state = {
        num : 0
    };
    componentDidMount() {
    }
    render() {

        return (
            <div>
                <h2>Lazy</h2>
                <hr/>
                <Suspense fallback={<div>Loading...</div>}>
                        <ContextDemo/>
                </Suspense>

            </div>
        );
    }
}
